import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * Created by LENOVO on 2018/5/27.
 */
public class SiServlet extends HttpServlet {
    protected  void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        response.setCharacterEncoding("gbk");

        PrintWriter out = response.getWriter();
        request.setCharacterEncoding("gb2312");
        String name = request.getParameter("name");
        out.println("<html>");
        out.println("<body>");
        out.println("表单中的值为:" + name + "<br>");
        out.println("</body>");
        out.println("</html>");
    }
}
